<?php

// This file is part of the Carrington Text Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }

?>


<nav>

<?php
global $post;     // if outside the loop

$children = wp_list_pages("title_li=&echo=0&depth=2");

// check if the page is the mediacenter to activate the submenu (68 is the other archive aircraft to exclude)
if(is_archive() == 1 && $post->post_name != 'head')
{
	$var1 = '"page_item page-item-22"';
    $var2 = '"page_item page-item-22 current_page_item"';
    $children = str_replace($var1, $var2, $children);
}

if ($children) { ?>
	<ul>
		
		<?php 
		echo $children;
		 ?>
	</ul>
<?php } ?>
	

</nav>
